<template>
  <div class="pageBox">
    <div class="auth" v-if="$store.state.user.id">
      <layout />
    </div>
    <div class="login" v-else>
      <router-view />
    </div>
  </div>
</template>

<script>
import layout from './layout.vue'

export default {
  components: {
    layout,
  },
  created() {
    this.$store.state.user = JSON.parse(localStorage.getItem(`user`) || `{}`)
  },
  data() {
    return {}
  },
}
</script>

<style>
body,
html {
  margin: 0;
  padding: 0;
}
</style>
<style lang="less" scoped>
.container {
  height: 100vh;
}
.el-header {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
}

.el-aside {
  color: #333;
}
</style>
